package es.itpyme.websip.util;

import java.util.Arrays;

public class CollectionUtil {
    /**
     * Tells if the first parameter is equal to any of the following parameters.
     *
     * @param <T>           parameter type.
     * @param o             object to compare.
     * @param items         items to be matched.
     * @return              <code>true</code> if the first parameter is equal to
     *                      any of the following parameters, <code>false</code>
     *                      otherwise.
     */
    public static <T> boolean isOneOf(T o, T... items) {
        return items == null? false : Arrays.asList(items).contains(o);
    }

}
